package EVM;


import Commons.Cell;

public class OneBitGate extends SimpleLogicGate {

    int bitNumberInput;
    int bitNumberOutput;

    public OneBitGate(Cell input, Cell output, String name, int bitNumberInput, int bitNumberOutput) {
        super(input, output, name);
        this.bitNumberInput = bitNumberInput;
        this.bitNumberOutput = bitNumberOutput;
    }

    @Override
    public void execute(boolean open) {
        if (open) {
            output.setBit(bitNumberOutput, input.getBit(bitNumberInput));
        }
    }
}
